package com.lfy.domian;

import lombok.Data;

import java.lang.reflect.Method;

@Data
public class Test {





    public static void main(String[] args) throws ClassNotFoundException {
        Class<?> my = Class.forName("com.lfy.domian.Test");
        Method[] methods = my.getDeclaredMethods();
        for(Method method:methods){
            System.out.println("方法名："+method.getName());
            Class<?>[] getTypes = method.getParameterTypes();
            if(getTypes.length ==0){
                System.out.println(method.getName()+"方法无参数");
            }
            for (Class<?> lei:getTypes){
                String parameterName = lei.getName();
                System.out.println("参数类型："+parameterName);
            }
            System.out.println("-------------------------");
        }
    }
}
